accountingIntegrationDashboardApp.controller('maintenanceReconciliationTypeCtrl', ['$scope', '$http', '$log', 'serverDataService','commonValidationService', function ($scope, $http, $log, serverDataService,commonValidationService){ 

    $scope.entityName = 'reconciliation-type';

    $scope.setChildScope($scope);
    $scope.renderRecordsFromServer();


    $scope.addReconciliationType = function() {
        $scope.inserted = {
        id: null,
        code: null,
        description: null
        };
        $scope.gridRecords.push($scope.inserted);
    };

    $scope.validateCode = function (columnName, data){
    	$scope.validateCodeMsg = null;
    	msg = commonValidationService.checkNotEmpty(columnName, data);
    	if (msg) {return msg;}
    	msg = commonValidationService.checkStringsOnly(columnName, data);
    	if (msg) {return msg;}
    };
                
    
    $scope.validateDescription = function (columnName, data){
    	$scope.validateCodeMsg = null;
    	msg = commonValidationService.checkNotEmpty(columnName, data);
    	if (msg) {return msg;}
    };    
}]);